﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

namespace LCA.Utils
{
    /// <summary>
    /// Summary description for PageHelper
    /// </summary>
    public class PageHelper
    {
        public static void AdminPageRedirect(Page page, string url)
        {
            page.Response.RedirectLocation = url;
            page.Response.StatusCode = 302;
            page.Response.End();
        }

        public static void ClientPageRedirect(Guid pageId)
        {
            HttpContext.Current.Response.Redirect("/page(" + pageId.ToString()+ ")");
            HttpContext.Current.Response.StatusCode = 302;
            HttpContext.Current.Response.End();
        }

        public static void ClientPageRedirect(string url)
        {
            HttpContext.Current.Response.Redirect(url);
            HttpContext.Current.Response.StatusCode = 302;
            HttpContext.Current.Response.End();
        }
    }
}
